<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  <title>城市缘-休闲情缘交友社区</title>
  <script type="text/javascript" src="https://openapi.360.cn/js/api/bridge.js"></script>
</head>
<body style="background:url(../../img/background.jpg) no-repeat;">
  <script type="text/javascript">
//初始化
Bridge.setup( 'ae4d0cb6e219b0b4407cbda2323c9fdb' );

var JiaoYouApp = {
    'login' : function() {
        var self = this;
        
        Bridge.connect.tryLogin(function(userData) {
            if (userData) {
                //alert( userData.id ); 
                self.saveUserInfo(userData);
            } 
            // 否则只能通过授权方式，才能拿到用户信息    
            else {
                Bridge.oauth2.getAuthCode({
                    'redirect_uri' : 'http://www.thenicecity.com/adapter/360/home.html?src=360', // 用户授权后，360开放平台回调地址
                    'state'  : '' // 可选 
                });  
            }
        });
        return false;
    },
    
    'saveUserInfo' : function(data) {
        var url = [
            '/login/?id=', data.id,                               // 用户ID
            '&name=', encodeURIComponent(data.name),              // 用户账号
            '&avatar=', encodeURIComponent(data.avatar),          // 头像地址
            '&timestamp=', encodeURIComponent(data.timestamp),    // 时间戳
            '&signature=', data.signature                         // 签名
        ].join('');
		
        if(data.id){
        // 页面跳转至校验地址
        window.location.href = 'http://www.thenicecity.com/adapter/360/home.html?src=360&uid='+data.id; 
		}
    }
};
JiaoYouApp.login();
  
function loginNow(){
	JiaoYouApp.login();
}

  </script>
 <div id="loadDiv" style="text-align: center;margin:0 auto;height:400px;">
		<div style="height:300px;"></div>
		<a href="#" onclick="loginNow()">马上登录>></a>
	</div>
</body>
</html>